#ifndef _VERTEX_H_
#define _VERTEX_H_

#include<cstring>
#include"Arc.h"

template<typename T>
class Vertex{

public:
	T vertex_data;
	Arc* first_arc;

public:
	Vertex(){
	}

	Vertex(T data, Arc* firstarc):
		vertex_data(data),first_arc(firstarc){
	}

	Vertex(const Vertex& vertex){
		if(this!=&vertex && 0!=&vertex){
			this->vertex_data = vertex.vertex_data;
			this->first_arc = new Arc(*vertex.first_arc);
		}
	}

	Vertex& operator=(const Vertex& vertex){
		if(this!=&vertex && 0!=&vertex){
			this->vertex_data = vertex.vertex_data;
			if(vertex.first_arc!=0){
				this->first_arc = new Arc(*vertex.first_arc);
			}else{
				this->first_arc = 0;
			}
		}
		return *this;
	}
	~Vertex(){
	}
};
#endif // _VERTEX_H_
